﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL_Class
{
 
   public  class Slide
    {
       NLLDataContext db = new NLLDataContext();
       public string AddNewSlide(SLIDE sli)
       {
           string result = string.Empty;
           try
           {
               db.SLIDEs.InsertOnSubmit(sli);
               db.SubmitChanges();

           }
           catch (Exception ex)
           {
               throw ex;
           }
           return result = "Thêm mới thành công";
       }
       public void DeleteSlide(int id) 
       {
           try
           {
               var a = db.sp_Slide_Delete(id);
           }
           catch (Exception ex)
           {
               throw ex;
           }
       }
       public string UpdateSlide(SLIDE sli)
       {
           string result = string.Empty;
           try
           {
               var a = db.sp_Slide_Update(sli.ID,sli.ThumbImage,sli.Description,sli.SlideImage,sli.Status,sli.Link);
           }
           catch (Exception ex)
           {
               throw ex;
           }
           return result = "Chỉnh Sửa thành công";
       }

    }
}
